package com.cloud.pole.shop.biz.shops;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Options;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.ace.cache.annotation.Cache;
import com.ace.cache.annotation.CacheClear;
import com.cloud.pole.common.biz.BaseBiz;
import com.cloud.pole.mapper.goods.ShopGoodsCategoryRecommMapper;
import com.cloud.pole.mapper.goods.ShopGoodsModelAttrMapper;
import com.cloud.pole.mapper.shops.ShopShopsUserMapper;
import com.cloud.pole.shop.model.entity.goods.ShopGoodsCategoryRecomm;
import com.cloud.pole.shop.model.entity.goods.ShopGoodsModelAttr;
import com.cloud.pole.shop.model.entity.shops.ShopShopsFans;
import com.cloud.pole.shop.model.entity.shops.ShopShopsUser;
import com.github.pagehelper.PageHelper;

import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.entity.Example.Criteria;

/**
 * ${DESCRIPTION}
 *
 * @author wanghaobin
 * @create 2017-06-08 16:23
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ShopShopsUserBiz extends BaseBiz<ShopShopsUserMapper, ShopShopsUser> {
	
	@Cache(key="shopShopsUser{1}-shopId-user{2}-openId-user")
    public ShopShopsUser selectByShopIdAndOpenId(Integer shopId, String openId) {
		ShopShopsUser record = new ShopShopsUser();
		record.setShopId(shopId);
		record.setOpenId(openId);	
	    return mapper.selectOne(record);
    }
	
	public void insertSelective(ShopShopsUser record) {
		mapper.insertSelective(record);
	}
	
	@Override
	@CacheClear(key = "shopShopsUser{1.shopId}-shopId-user{1.openId}-openId-user")
	public void updateSelectiveById(ShopShopsUser record) {
		super.updateSelectiveById(record);
	}
}
